

/*
 * UNPUBLISHED PROPRIETARY INFORMATION
 * Copyright (c) 2007-2008 Sentilla Corporation
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * Sentilla Corporation ("Confidential Information"). Disclosure of this
 * Confidential Information is prohibited, and its use shall be in
 * compliance with terms of the license agreement with Sentilla Corporation.
 */

/**
 * A stub host application that listen for messages from the mote network.
 *
 * @author <a href="mailto:info@sentilla.com">Sentilla Corporation</a>
 */



import java.util.HashMap;
import java.util.Map;
import java.util.Random;

import at.fhhagenberg.se.tjr.protocol.CheckTrafficJam;
import at.fhhagenberg.se.tjr.protocol.TraceMessage;
import at.fhhagenberg.se.tjr.protocol.TrafficJamAhead;
import at.fhhagenberg.se.tjr.protocol.TrafficJamMessage;

import com.sentilla.host.client.HostClient;
import com.sentilla.net.BroadcastAddress;
import com.sentilla.net.Receiver;
import com.sentilla.net.ReceiverDriver;
import com.sentilla.net.SenderDriver;
import com.sentilla.net.Sender;

public class SimpleMonitoringClient {
	
	public static class SenderThread extends Thread{
		
		
	}
	
	
	
    public static void main(String[] args) throws Exception {
        //  Create a host environment that virtualizes communication with the motes.
    	HostClient hostClient = new HostClient();
    	//  Tell the hostClient to connect to the default ip address and port (127.0.0.1:10004)
    	hostClient.connect();
    	
    	SenderThread st = new SenderThread();
    	st.start();
        // The primary host application: receive messages from the mote network
        // and manually print their contents to stdout.
        Object obj = new Object();
        Receiver recv = ReceiverDriver.create(obj.getClass());
        while (true) {
        	if (obj instanceof TraceMessage) {
				TraceMessage msg = (TraceMessage) obj;
				
			}
            obj = recv.receive();
            Class c = obj.getClass();
            	System.out.println(c.getSimpleName());
            	System.out.println("Received: " + ((TrafficJamMessage)obj).getMoteId() );
        }
    }
}